using System;
using System.Collections.Generic;
using WorkOrders.Data;
using WorkOrders.Domain.Entities;

namespace WorkOrders.Domain.BLL
{
    public class CustomerManager
    {
        public IList<Customer> GetAllCustomers()
        {
            return new Repository<Customer>().FindAll();
        }

        public void SaveCustomer(Customer customer)
        {
            new Repository<Customer>().SaveOrUpdate(customer);
        }

        public Customer GetCustomer(int customerId)
        {
            return new Repository<Customer>().Find(customerId);
        }

        public void UpdateStatus(int customerId, string status)
        {
            var repository = new Repository<Customer>();
            var customer = repository.Find(customerId);
            customer.Status = status;
        }
    }
}